package com.thread.sync.sync06;

import java.util.concurrent.Callable;

//真实数据类,需要实现Callable接口
public class RealData implements Callable<String> {
    private String param;

    public RealData(String param) {
        this.param = param;
    }

    //Call方法会构造我们需要的真实数据并返回
    @Override
    public String call() throws Exception {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < 10; i++) {
            sb.append(param);
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {

            }
        }
        return sb.toString();
    }

}
